/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.BasicInteractions;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;


import edu.pku.sei.modeler.model.uml.Kernel.NamedElement;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class GeneralOrdering extends NamedElement implements IGeneralOrdering {
	// attributes
	
	protected OccurrenceSpecification before;
	
	protected OccurrenceSpecification after;
	
	
	
	
	// references
	
	
	
	// getters & setters for attributes
	
	public OccurrenceSpecification getBefore() {
		return before;
	}
	public void setBefore(OccurrenceSpecification newBefore) {
		OccurrenceSpecification oldbefore = before;
		before = newBefore;
		firePropertyChange(ModelPackage.GENERALORDERING_BEFORE, oldbefore, newBefore);
	}
	
	public OccurrenceSpecification getAfter() {
		return after;
	}
	public void setAfter(OccurrenceSpecification newAfter) {
		OccurrenceSpecification oldafter = after;
		after = newAfter;
		firePropertyChange(ModelPackage.GENERALORDERING_AFTER, oldafter, newAfter);
	}
	
	// getters for references
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeNode(root, ModelPackage.GENERALORDERING_BEFORE, before);
		
		XMLUtility.xmlInstance.serializeNode(root, ModelPackage.GENERALORDERING_AFTER, after);
		
		// references
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		before = (OccurrenceSpecification)XMLUtility.xmlInstance.deSerializeNode(root, ModelPackage.GENERALORDERING_BEFORE, this);
		
		after = (OccurrenceSpecification)XMLUtility.xmlInstance.deSerializeNode(root, ModelPackage.GENERALORDERING_AFTER, this);
		
		// references
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		else if(ModelPackage.GENERALORDERING_BEFORE.equals(featureID)) {
			before = (OccurrenceSpecification)value;
		}
		
		else if(ModelPackage.GENERALORDERING_AFTER.equals(featureID)) {
			after = (OccurrenceSpecification)value;
		}
		
		// references
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 